home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / dvglue10.arc / TVQTITLE.C < prev    next >
C/C++ Source or Header  |  1988-08-13  |  1KB  |  40 lines

  1. /*=======================================================*/
  2. /*  TVQTITLE.C                                           */
  3. /*                                                       */
  4. /*  (c) Copyright 1988 Ralf Brown  All Rights Reserved   */
  5. /*  May be freely copied for noncommercial use, so long  */
  6. /*  as this copyright notice remains intact, and any     */
  7. /*  changes are marked in the comment blocks preceding   */
  8. /*  functions.                                           */
  9. /*=======================================================*/
  10.  
  11. #include <string.h>
  12. #include "tvapi.h"
  13. #include "tvstream.h"
  14.  
  15. /*=======================================================*/
  16. /* TVqry_title--get window's title                       */
  17. /*   Ralf Brown 4/3/88                                   */
  18. /*=======================================================*/
  19.  
  20. void pascal TVqry_title(OBJECT win,char *title,int size)
  21. {
  22.    BYTE *query_stream = (BYTE *) malloc(size+6) ;
  23.  
  24.    if (query_stream)
  25.       {
  26.       size-- ;
  27.       query_stream[0] = 0x1B ;
  28.       query_stream[1] = 0x01 ;
  29.       *((int *)(query_stream+2)) = size + 2 ;
  30.       query_stream[4] = 0xEF ;
  31.       query_stream[5] = size ;
  32.       TVwin_stream(win,query_stream) ;
  33.       strncpy(title,(char *)query_stream+6,size) ;
  34.       title[size] = '\0' ;
  35.       free(query_stream) ;
  36.       }
  37. }
  38.  
  39. /* End of TVQTITLE.C */
  40.